package com.jzit168.module_home.entity.data

import com.jzit168.library_base.ext.flowIO
import com.jzit168.library_utils.date2string
import com.jzit168.module_home.entity.DemoBean
import kotlinx.coroutines.flow.flow

/**
 *@Desc:
 *@Author: Android Developer
 *@Date: 2020/10/21
 *
 **/
class HomeDataSource {

    fun testData() = flow {
        val list = mutableListOf<DemoBean>()
        for (it in 0..4) {
            DemoBean(
                id = it,
                title = "内容$it",
                date = System.currentTimeMillis().date2string("yyyy.MM.dd")
            ).let {
                list.add(it)
            }
        }
        emit(list)
    }.flowIO()
}